feat: add wait command with non-zero exit on failure#28
Conversation
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||
bfb8ffc to
d0c3beb
Compare
46fd3ff to
b225b2b
Compare
7185868 to
fd30aad
Compare
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace ctx.exit(1) with raise SystemExit(1) to ensure click.echo output is flushed before the process exits. ctx.exit(1) can suppress output in some Python/Click versions (e.g. Python 3.9). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensures the DB session is properly committed before raising SystemExit to avoid leaving the database in a bad state. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
5110b54 to
44f8e71
Compare
Use return_value instead of side_effect iterator to avoid mock exhaustion from GC-triggered __del__ calls on some Python versions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents __del__ race condition on CI where GC runs between submit and subsequent commands, deleting the DB. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
__del__ was deleting the DB on GC due to SQLite session isolation — a new session in __del__ couldn't see rows committed by another engine instance. Now __del__ only disposes the engine, and DB cleanup is called explicitly after delete commands. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cc2d024 to
a475127
Compare
|
@Yannick-Dayer Changes since your last review: Fixed All tests pass, tested on real Slurm 20.11.4. Ready for re-review. |
Yannick-Dayer
left a comment
There was a problem hiding this comment.
Good catch on that __del__ bug.
The following comment is a suggestion and not required if you don't feel like applying it, so I'm approving again.
| @@ -312,4 +312,6 @@ def __del__(self): | |||
| Path(self.database).unlink() | |||
| if self.logs_dir.exists() and len(os.listdir(self.logs_dir)) == 0: | |||
There was a problem hiding this comment.
You could use pathlib's Path.rglob instead of os.listdir
| if self.logs_dir.exists() and len(os.listdir(self.logs_dir)) == 0: | |
| if self.logs_dir.exists() and len(list(self.logs_dir.rglob("*"))) == 0: |
There was a problem hiding this comment.
Or even Path.iterdir() as suggested by the pathlib documentation
There was a problem hiding this comment.
sorry I missed this. I will keep it in mind for the next iteration. Thank you for all the quick review feedbacks. I am using gridtk with agents and they surprisingly use it really well without introduction.
Summary
gridtk waitcommand that polls jobs until all reach a terminal stateWaiting for 5 job(s): 3 pending, 2 running--intervaloption and all standard job filtersJobManager.__del__deleting DB due to SQLite session isolation — moved to explicitcleanup_empty_database()called after every CLI commandwaitcommand in READMEExamples
🤖 Generated with Claude Code
📚 Documentation preview 📚: https://gridtk--28.org.readthedocs.build/en/28/